import axios from '@/libs/api.request'

export const login = ({
  userName,
  password
}) => {
  const data = {
    userName,
    password
  }
  return axios.request({
    url: 'account/login',
    data,
    method: 'post'
  })
}

export const getUserInfo = (token) => {
  return axios.request({
    url: 'get_info',
    params: {
      token
    },
    method: 'get'
  })
}

export const logout = (token) => {
  return axios.request({
    url: 'account/login_out',
    params: {
      token
    },
    method: 'post'
  })
}

export const getUsers = ({
  page,
  size
}) => {
  const data = {
    page,
    size
  }
  return axios.request({
    url: 'user/get',
    params: data,
    method: 'get'
  })
}
